#include <iostream>

using namespace std;

const int N = 40;
int dp[N][N];

int main()
{
	int n;
	cin >> n;

	dp[1][1] = 1;
	for (int i = 2; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1];
		}
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			printf("%5d", dp[i][j]);
		}
		printf("\n");
	}
	return 0;
}